package com.wilmar.process.entity;

import java.util.Date;

import javax.persistence.Enumerated;

import com.wilmar.process.enumerate.EnumProcessLogLevel;
import com.wilmar.process.enumerate.EnumProcessOperateOpinionType;

/**
 * ProcessLog entity. @author MyEclipse Persistence Tools
 */

public class ProcessLog implements java.io.Serializable {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 231241565626138805L;
	// Fields

	private Long id;
	private Integer version;
	private String processInstanceId;
	private String processDefinitionName;
	private Date enterTime;
	private Date leaveTime;
	private String operator;
	private String operatorName;
	private String opinionString;
	private EnumProcessOperateOpinionType opinionType;
	private String nodeName;
	private String nodeDesc;
	private String instanceStarter;
	private EnumProcessLogLevel logLevel;
	private String outerSystem;
	private String outCome;
	private String executionId;

	// Constructors

	/** default constructor */
	public ProcessLog() {
	}

	/** minimal constructor */
	public ProcessLog(Integer version,
			EnumProcessOperateOpinionType opinionType, String outerSystem) {
		this.version = version;
		this.opinionType = opinionType;
		this.outerSystem = outerSystem;
	}

	/** full constructor */
	public ProcessLog(Integer version, String processInstanceId,
			String processDefinitionName, Date enterTime, Date leaveTime,
			String operator, String operatorName, String opinionString,
			EnumProcessOperateOpinionType opinionType, String nodeName,
			String nodeDesc, String instanceStarter,
			EnumProcessLogLevel logLevel, String outerSystem, String outCome,
			String executionId) {
		this.version = version;
		this.processInstanceId = processInstanceId;
		this.processDefinitionName = processDefinitionName;
		this.enterTime = enterTime;
		this.leaveTime = leaveTime;
		this.operator = operator;
		this.operatorName = operatorName;
		this.opinionString = opinionString;
		this.opinionType = opinionType;
		this.nodeName = nodeName;
		this.nodeDesc = nodeDesc;
		this.instanceStarter = instanceStarter;
		this.logLevel = logLevel;
		this.outerSystem = outerSystem;
		this.outCome = outCome;
		this.executionId = executionId;
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/**
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof ProcessLog))
			return false;
		ProcessLog other = (ProcessLog) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	// Property accessors

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getProcessInstanceId() {
		return this.processInstanceId;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public Date getEnterTime() {
		return this.enterTime;
	}

	public void setEnterTime(Date enterTime) {
		this.enterTime = enterTime;
	}

	public Date getLeaveTime() {
		return this.leaveTime;
	}

	public void setLeaveTime(Date leaveTime) {
		this.leaveTime = leaveTime;
	}

	public String getOperator() {
		return this.operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getOpinionString() {
		return this.opinionString;
	}

	public void setOpinionString(String opinionString) {
		this.opinionString = opinionString;
	}

	@Enumerated
	public EnumProcessOperateOpinionType getOpinionType() {
		return this.opinionType;
	}

	public void setOpinionType(EnumProcessOperateOpinionType opinionType) {
		this.opinionType = opinionType;
	}

	public String getNodeName() {
		return this.nodeName;
	}

	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	public String getNodeDesc() {
		return this.nodeDesc;
	}

	public void setNodeDesc(String nodeDesc) {
		this.nodeDesc = nodeDesc;
	}

	public String getInstanceStarter() {
		return this.instanceStarter;
	}

	public void setInstanceStarter(String instanceStarter) {
		this.instanceStarter = instanceStarter;
	}

	@Enumerated
	public EnumProcessLogLevel getLogLevel() {
		return this.logLevel;
	}

	public void setLogLevel(EnumProcessLogLevel logLevel) {
		this.logLevel = logLevel;
	}

	public String getOuterSystem() {
		return this.outerSystem;
	}

	public void setOuterSystem(String outerSystem) {
		this.outerSystem = outerSystem;
	}

	/**
	 * @return the version
	 */
	public Integer getVersion() {
		return version;
	}

	/**
	 * @param version
	 *            the version to set
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}

	/**
	 * @return the processDefinitionName
	 */
	public String getProcessDefinitionName() {
		return processDefinitionName;
	}

	/**
	 * @param processDefinitionName
	 *            the processDefinitionName to set
	 */
	public void setProcessDefinitionName(String processDefinitionName) {
		this.processDefinitionName = processDefinitionName;
	}

	/**
	 * @return the outCome
	 */
	public String getOutCome() {
		return outCome;
	}

	/**
	 * @param outCome
	 *            the outCome to set
	 */
	public void setOutCome(String outCome) {
		this.outCome = outCome;
	}

	/**
	 * @return the executionId
	 */
	public String getExecutionId() {
		return executionId;
	}

	/**
	 * @param executionId
	 *            the executionId to set
	 */
	public void setExecutionId(String executionId) {
		this.executionId = executionId;
	}

	/**
	 * @return the operatorName
	 */
	public String getOperatorName() {
		return operatorName;
	}

	/**
	 * @param operatorName
	 *            the operatorName to set
	 */
	public void setOperatorName(String operatorName) {
		this.operatorName = operatorName;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return "ProcessLog [enterTime=" + enterTime + ", executionId="
				+ executionId + ", id=" + id + ", instanceStarter="
				+ instanceStarter + ", leaveTime=" + leaveTime + ", logLevel="
				+ logLevel + ", nodeDesc=" + nodeDesc + ", nodeName="
				+ nodeName + ", operator=" + operator + ", operatorName="
				+ operatorName + ", opinionString=" + opinionString
				+ ", opinionType=" + opinionType + ", outCome=" + outCome
				+ ", outerSystem=" + outerSystem + ", processDefinitionName="
				+ processDefinitionName + ", processInstanceId="
				+ processInstanceId + ", version=" + version + "]";
	}
}